﻿using DFGK_WMS.Model.Enum;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace DFGK_WMS.Model.Models
{
    /// <summary>
    /// 收货单明细
    /// </summary>
    [Table("T_ReceivingBillDetail")]
    public class ReceivingBillDetail:BaseEntity
    {   
        /// <summary>
        /// 关联单Id
        /// </summary>
        public long BillId { get; set; }
        /// <summary>
        /// 关联单号
        /// </summary>
        [MaxLength(30)]
        public string BillNo { get; set; }
        /// <summary>
        /// 行号
        /// </summary>
        [MaxLength(30)]
        public string BillLineNo { get; set; }
        /// <summary>
        /// 物料Id
        /// </summary>
        public long MaterialId { get; set; }
        /// <summary>
        /// 物料编码
        /// </summary>
        [MaxLength(30)]
        public string MaterialCode { get; set; }
        /// <summary>
        /// 物料名称
        /// </summary>
        [MaxLength(30)]
        public string MaterialName { get; set; }

        /// <summary>
        /// 物料条码（69码）
        /// </summary>
        [MaxLength(30)]
        public string Articlebarcode { get; set; }

        /// <summary>
        /// 物料类型编码
        /// </summary>
        [MaxLength(30)]
        public string MaterialTypeCode { get; set; }
        /// <summary>
        /// 物料类型名称
        /// </summary>
        [MaxLength(30)]
        public string MaterialTypeName { get; set; }
        /// <summary>
        /// 数量
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal Qty { get; set; }
        /// <summary>
        /// 收货数量
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal ReceivedQty { get; set; }
        /// <summary>
        /// 状态：0-未收货；1-已收货；
        /// </summary>
        public int Status { get; set; }
     
        /// <summary>
        /// 确定时间
        /// </summary>
        public DateTime? ConfirmDate { get; set; }
        /// <summary>
        /// 采购单号
        /// </summary>
        [MaxLength(30)]
        public string PurchaseOrderNo { get; set; }
        /// <summary>
        /// 生产日期
        /// </summary>
        public DateTime? ProductDate { get; set; }
        /// <summary>
        /// 供应商Id
        /// </summary>
        public long? SupplierId { get; set; }
        /// <summary>
        /// 供应商
        /// </summary>
        [MaxLength(30)]
        public string SupplierName { get; set; }

        /// <summary>
        /// 批次号
        /// </summary>
        [MaxLength(30)]
        public string BatchNo { get; set; }
        /// <summary>
        /// CheckedQTY
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? CheckedQty { get; set; }
        /// <summary>
        /// 需质检数量
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? NeedCheckQty { get; set; }
        /// <summary>
        /// 是否需质检
        /// </summary>
        public bool? IsNeedQc { get; set; }
        /// <summary>
        /// 单价
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? Price { get; set; }
        /// <summary>
        /// 总计
        /// </summary>
        [Column(TypeName = "decimal(18,2)")]
        public decimal? TotalPrice { get; set; }
        /// <summary>
        /// 批次号说明
        /// </summary>
        [MaxLength(30)]
        public string BatchNoExplain { get; set; }
        /// <summary>
        /// 生产厂家
        /// </summary>
        [MaxLength(30)]
        public string ProduceFactory { get; set; }
        /// <summary>
        /// 出场日期
        /// </summary>
        public DateTime? OutFactoryDate { get; set; }
        /// <summary>
        /// 有效日期
        /// </summary>
        public DateTime? ExpireDate { get; set; }

        /// <summary>
        /// 以下三个用于手动添加收货单时使用
        /// </summary>
        [NotMapped]
        public long AreaId { get; set; }
        /// <summary>
        /// 盐城项目使用 高中低位
        /// </summary>
        [NotMapped]
        public EmLayer? Layer { get; set; }

        [NotMapped]
        public string StoLocation { get; set; }

        [NotMapped]
        public bool IsPick { get; set; } = false;
    }
}
